# Maintainer: Levente Polyak <anthraxx[at]archlinux[dot]org>
# Contributor: Giovanni Scafora <giovanni@archlinux.org>
# Contributor: Manolis Tzanidakis

pkgname=perl-net-ssleay
_cpanname=Net-SSLeay
pkgver=1.92
pkgrel=2
pkgdesc='Perl bindings for OpenSSL and LibreSSL'
url='https://search.cpan.org/dist/Net-SSLeay/'
arch=('x86_64')
license=('custom:BSD')
depends=('openssl')
makedepends=('chrpath')
replaces=('net-ssleay')
provides=('net-ssleay')
options=('!emptydirs')
source=(https://cpan.metacpan.org/authors/id/C/CH/CHRISN/${_cpanname}-${pkgver}.tar.gz)
sha512sums=('e9d9161ebeb7be90f4c7a0ea98f1034892ce6d33aa72872683177b19daa1f4c5819f85ea9a052a076ec8d7c21705f6c344aef64680bc881bf3218d38e8b7b173')
b2sums=('04d97860817b013a9680e0ef29b0004ddb98da2db859761a45612c4d25b6edd16bf92645293d1108d83352bce18665721c6df05455426b32a95a42b464119a3d')

build() {
  cd ${_cpanname}-${pkgver}
  PERL_MM_USE_DEFAULT=1 perl Makefile.PL INSTALLDIRS=vendor
  make
}

check() {
  cd ${_cpanname}-${pkgver}
  make test
}

package() {
  cd ${_cpanname}-${pkgver}

  make install DESTDIR="${pkgdir}"
  install -Dm 644 README -t "${pkgdir}/usr/share/doc/${pkgname}"
  install -Dm 644 LICENSE -t "${pkgdir}/usr/share/licenses/${pkgname}"

  # strip rpath
  find "${pkgdir}" -name '*.so' -exec chrpath -d '{}' \;
}

# vim: ts=2 sw=2 et:
